<?php

namespace App\Http\Controllers\User;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class HeighLightController extends Controller
{
    //
    public function getHeighLightList(){
        try{
            $chose =DB::table('aboutcompany')->where('type','=','2')->select('aboutcompany_id','aboutcompany_image','time','other','title')->get();

            return json_encode(['msg'=>1,'data' => $chose]);

        }catch (Exception $e){

            $info =  $e->getMessage().'failed line:'.$e->getLine().'failed string:'.$e->getTraceAsString();
            return json_encode(['msg'=>0,'data' => $info]);
            exit;
        }
}

    public function getHeighLightInfo(Request $request){

        try{

            $aboutcompany_id = $request->input('aboutcompany_id');
            $chose = DB::table('aboutcompany')->where('aboutcompany_id','=',$aboutcompany_id)->get();

            return json_encode(['msg'=>1,'data' => $chose]);

        }catch (Exception $e){

            $info =  $e->getMessage().'failed line:'.$e->getLine().'failed string:'.$e->getTraceAsString();
            return json_encode(['msg'=>0,'data' => $info]);
            exit;
        }
    }
}
